package com.iversonx.scene_1.v2.decoration;

import com.iversonx.scene_1.entity.Matter;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 *
 **/
@Data
public class DecorationPackage {
    
    private Integer level;
    
    /**
     * 装修清单
     */
    private List<Matter> list = new ArrayList<>();
    
    /**
     * 装修价格
     */
    private BigDecimal price = BigDecimal.ZERO;
    
    /**
     * ⾯积
     */
    private BigDecimal area;
    
    /**
     * 装修等级；豪华欧式、轻奢⽥园、现代简约
     */
    private String grade;
    
    @Override
    public String toString() {
        StringBuilder detail = new StringBuilder("\r\n-------------------------------------------------------\r\n" +
                "装修清单" + "\r\n" +
                "套餐等级：" + level + "\r\n" +
                "套餐价格：" + price.setScale(2, BigDecimal.ROUND_HALF_UP) + " 元\r\n" +
                "房屋面积：" + area.doubleValue() + " 平米\r\n" +
                "材料清单：\r\n");
    
        for (Matter matter: list) {
            detail.append(matter.scene()).append("：").append(matter.brand()).append("、").append(matter.model()).append("、平米价格：").append(matter.price()).append(" 元。\n");
        }
        return detail.toString();
    }
}
